package com.example.materialviewpagerdemo.view;

import android.content.Context;
import android.graphics.Typeface;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.TextView;

public class FontTextView extends android.support.v7.widget.AppCompatTextView {
    public FontTextView(Context context) {
        super(context);
        initFont();
    }

    public FontTextView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initFont();
    }

    public FontTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initFont();
    }

    private void initFont()
    {
        if (!isInEditMode())
        {
            Typeface typeface=Typeface.createFromAsset(getContext().getAssets(),"fonts/fyyfont.ttf");
            setTypeface(typeface);
        }
    }
}
